You can write some text appearing in both files using the standard markup language.
Use the r chunk to display some code in both files.
head(cars)
## speed dist
## 1 4 2
## 2 4 10
## 3 7 4
## 4 7 22
## 5 8 16
## 6 9 10
Use the r chunk with solution = TRUE to display and evaluate the chunk only in the solution file.
You can also add some markdown formatted text with the asis engine together with solution = TRUE
Use the knit dropdown menu on the knit button to generate the desired output:
unilur::tutorial_pdf_solution or unilur::tutorial_html_solution will show the solution boxes.unilur::tutorial_pdf or unilur::tutorial_html will hide them from the output.cars dataset?library().